import { useState,useEffect } from 'react'
import logo from './logo.svg'
import './App.css'
import Shopping from './components/Shopping'
import { getData } from './api/request'

function App() {
  const [activityKey,setActivityKey]=useState('caodian')
  const [goodsData,setGoodsData]=useState([])


  useEffect(()=>{
    (async()=>{
        let {data}=await getData()
        // console.log(data);
        setGoodsData([...data])
    })()
  })

  return (
    <div className="App">
      <Shopping setActivityKey={setActivityKey} activityKey={activityKey} goodsData={goodsData}/>
    </div>
  )
}

export default App
